We are migrating the bug tracker to github Issues. This is now the preferred way to report NASM bugs.

Self-registration is disabled due to spam issue (mail gorcunov@gmail.com or hpa@zytor.com to create an account)

Bug 3392925 - (-f obj) Defining label, using it for an equate, and specifying the equate as EXTERN leads to "inconsistently redefined" error
Summary: (-f obj) Defining label, using it for an equate, and specifying the equate as...
Status: OPEN
Alias: None
Product: NASM
Classification: Unclassified
Component: Assembler (show other bugs)
Version: 2.16.xx
Hardware: All All
: Medium severe
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2024-11-16 02:14 PST by E. C. Masloch
Modified: 2024-11-16 02:14 PST (History)
4 users (show)

Obtained from: Built from git using configure
Generated by: Human
Bug category: Incorrect main output, Unexpected or confusing behavior
Observed for: Development code
Regression: ---
Regression since:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description E. C. Masloch 2024-11-16 02:14:50 PST
As for some other bugs this only happens if something is assembled before the label being defined. (The test4.nas case drops the NOP and thus works.)

I first noticed that this occurred when the equate is only different in capitalisation but as test5.nas shows this is not needed to cause the bug.


test$ cat test.nas
nop

Foo:
global Foo

foo equ Foo
        extern foo
        call foo
test$ cat test2.nas
nop

Foo:

foo equ Foo
        extern foo
        call foo
test$ cat test3.nas
nop

Foo:

foo equ Foo
        extern foo
test$ cat test4.nas
Foo:

foo equ Foo
        extern foo
test$ cat test5.nas
nop

foo:

bar equ foo
        extern bar
test$ nasm -v
NASM version 2.16.02rc2 compiled on Oct 12 2023
test$ nasm -f obj test.nas
test.nas:7: error: label `foo' inconsistently redefined
test.nas:6: info: label `foo' originally defined here
test$ nasm -f obj test2.nas
test2.nas:6: error: label `foo' inconsistently redefined
test2.nas:5: info: label `foo' originally defined here
test$ nasm -f obj test3.nas
test3.nas:6: error: label `foo' inconsistently redefined
test3.nas:5: info: label `foo' originally defined here
test$ nasm -f obj test4.nas
test$ nasm -f obj test5.nas
test5.nas:6: error: label `bar' inconsistently redefined
test5.nas:5: info: label `bar' originally defined here
test$